import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/center'
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import('../views/About.vue')
  },
  {
    path: '/center',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import('../views/center/index.vue'),
    children: [
      {
        name: 'Home',
        path: 'home',
        component: () => import('../views/center/components/home.vue')
      },
      {
        name: 'Video',
        path: 'video',
        component: () => import('../views/center/components/video.vue')
      },
      {
        name: 'People',
        path: 'people',
        component: () => import('../views/center/components/people.vue')
      },
      {
        name: 'Service',
        path: 'service',
        // component: () => import('../views/center/components/service.vue')
        component: () => import('../views/services/services.vue')
      },
      {
        name: 'Mine',
        path: 'mine',
        component: () => import('../views/center/components/mine.vue')
      }
    ]
  },
  {
    name: 'Media',
    path: '/media',
    component: () => import('../views/center/components/media.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
